/*!
 *  \file       test-sinusoid.cpp
 *  \brief      Main per testare un segnale di tipo sinusoidale
 *
 *  \author     Davide Scola <S2299453@studenti.unige.it>
 *  \author	Minetti Alberto <S3064777@studenti.unige.it>
 *  \version    1.0
 */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <vector>
#include <iostream>

#include "IEntropyGenerator.hpp"
#include "TimeEntropyGenerator.hpp"
#include "DeviceEntropyGenerator.hpp"
#include "SmartEntropyGenerator.hpp"

#include "IRandomGenerator.hpp"
#include "SimpleRandomGenerator.cpp"
#include "NormalizedRandomGenerator.cpp"
#include "IntervalRandomGenerator.cpp"
#include "GaussRandomGenerator.cpp"

#include "ISignalGenerator.hpp"	
#include "SineSignalGenerator.cpp"
#include "InputSignal.cpp"

#include "ISignalNoise.hpp"
#include "GaussianNoise.cpp"

#include "WrapNumber.cpp"
#include "RealNumber.hpp"


using namespace std;


// Generatore di entropia (globale cosi` che
// venga inizializzato una sola volta )
SmartEntropyGenerator entropy;


int
main( void )
{
  // genero un segnale sinusoidale
  SineSignalGenerator< RealNumber > generator( SINUSOID_NPOINTS );
  InputSignal< RealNumber > clean( SINUSOID_NPOINTS, generator );
  
  // inizializzo il segnale "sporco"
  InputSignal< RealNumber > dirty( clean );
  
  GaussianNoise< RealNumber >
    noise( RealNumber( 0 ), RealNumber( pow( 0.01 * clean.getMax( ), 2 ) ), entropy );
  
  dirty.addNoise( noise );
  
  // visualizzo i risultati
  for( unsigned long int i = 0; i < SINUSOID_NPOINTS; ++i )
    cout << i << " " << clean[i] << " " << dirty[i] << endl;
  
  return 0;
}
